{% extends "base/base_layout.html" %}
{% block sidebar_option %}
    sidebar-collapse
{% endblock %}
{% block content %}
    <div class="content-wrapper">
        <div class="content-header">
        </div>
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-body">
                            <h3 class="page-header"><strong>Frida Logs </strong>- {{ package }}</h3>
                            <div id="messages"></br>每10秒刷新一次.</div>
                            <pre id="logs"></pre>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
{% block extra_scripts %}
    <script type="text/javascript">

        $(document).ready(function () {
            function get_logs() {
                $.ajax({
                    url: '/frida_logs/?hash={{ hash }}&stream=1',
                    type: "GET",
                    dataType: "json",
                    success: function (json) {
                        $('#logs').text(json.data);
                    },
                    error: function (xhr, ajaxOptions, thrownError) {
                        console.log(xhr.responseText);
                    }
                });
            }

            get_logs();
            setInterval(function () {
                get_logs();
            }, 10000);
        });

    </script>
{% endblock %}